import { request } from '@/utils/request';

import {PageData} from '@/api/model/pageModel'
import {SystemLogInfo} from '@/api/model/logModel'

const Api = {
  TicketList: '/component/wx/log',
  DeleteWxLog:'/component/wx/log/delete',
  SysLogList:'/log/sys',
  ClearLog:'/log/sys/clear',
  DeleteLog:'/log/sys/delete'
};

//获取系统日志
export function getLogList( page:number,pageSize:number) {
  return request.get<PageData<SystemLogInfo>>({
    url: Api.SysLogList+'?page='+page+'&pageSize='+pageSize,
  });
}
//清空系统日志
export function clearSysLog(){
  return request.post<string>({
    url:Api.ClearLog
  })
}
//删除指定记录的日志
export function deleteSysLog(ids:any){
  return request.post<string>({
    url:Api.DeleteLog,
    data:ids
  })
}

//获取微信消息
export function getWxLogList(page:number,pageSize:number)
{
  return request.get<PageData<SystemLogInfo>>({
    url:Api.TicketList+'?page='+page+'&rows='+pageSize
  });
}
//删除微信消息
export function deleteWxLog(ids:any)
{
  return request.post<string>({
    url:Api.DeleteWxLog,
    data:ids
  })
}
